import { Outlet,history,useLocation } from "@umijs/max";
import { useEffect } from "react";

export default () => {
    const location = useLocation()

    useEffect(() => {
        const token = localStorage.getItem('user')
        if (!token) {
            history.push('/login')
        }
    }, [location.pathname])

    return <>
        <Outlet />
    </>
}